package com.situ.spring.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;

import com.situ.spring.entity.Course;
import com.situ.spring.service.ICourseService;

/*
<bean name="courseController" class="com.situ.spring.controller.CourseController">
</bean>

@Controller 这个注解相当于在applicationContext.xml中写的上面的bean，
默认的名字是类名的首个单词小写courseController
*/
@Controller("courseController")
public class CourseController {
	
	// <property name="courseService" ref="courseService"/>
	// @Resource：从Spring容器中根据名字拿出指定的对象注入进来
	@Resource(name = "courseService")
	private ICourseService courseService;
	
	public void findAll() {
		System.out.println("CourseController.findAll()");
		List<Course> list = courseService.findAll();
	}
}
